#include <stdio.h>
#include <stdlib.h>
#include "../utils/log.h"
#include "../utils/ini.h"
#include "../utils/array.h"
#include <assert.h>
int main()
{
    const char *file_path = "test.ini";
    ini_t *ini = ini_parse_file(file_path);
    ini_print(ini);
    char *ip = ini_find_parameter_val(ini, "database", "ip");
    char *port = ini_find_parameter_val(ini, "database", "port");
    char *type = ini_find_parameter_val(ini, "database", "type");
    log_debug("database=>ip:%s port:%s type:%s", ip, port, type);
    array_t *arr = ini_find_parameters(ini, "server");
    for (size_t i = 0; i < arr->len; i++)
    {
        ini_parameter_t *p = (ini_parameter_t *)array_get(arr, i);
        log_warning("server=>key:%s val:%s", p->key, p->val);
    }
    ini_free(&ini);
    return 0;
}